﻿<%@ Page Language="C#" MasterPageFile="~/FrameMasterPage.master" AutoEventWireup="true" CodeFile="sparepartWarrantyAlert.aspx.cs" Inherits="sparepartWarrantyAlert" Title="Untitled Page" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="m_contentBody" Runat="Server">

<table  class="GridItem" cellspacing="2" cellpadding="2" style="width:auto">
  <tr><td class="BigLabel"><asp:Label ID="lblTotalEquipment" runat="server"></asp:Label><asp:Label ID="lblMessageValidate" runat="server" CssClass="permissionstyle"></asp:Label></td></tr>
  <tr>
  <td align="right" valign="top">
        &nbsp <asp:Label ID="lbldate" runat=server>Date end of warranty:</asp:Label>
            <asp:TextBox ID="txtPurchaseDate" runat="server" Width="89px"></asp:TextBox>
            <asp:Image ID="imgCalendar" runat="server" ImageUrl="~/images/calendar.png" /> 
            <asp:Button  ID="btnSearch" runat="server" Height="25px" Text="Go" CssClass="btnexpress" 
        Width="52px" BorderStyle="Dotted" onclick="btnSearch_Click" />
                    
            
  </td>
  </tr>
  <tr>
  <td  align="center" class="GridItem"  style="text-align:center">
             <asp:GridView ID="grdTemporary" runat="server" AllowPaging="True" Width="750px" 
                     AutoGenerateColumns="False"  Visible ="False" DataSourceID="dsMessage" 
                     
                     CellPadding="4" ForeColor="#333333" GridLines="None" 
                 onselectedindexchanged="grdTemporary_SelectedIndexChanged">
                 <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                 <RowStyle BackColor="#EFF3FB" />
                 <Columns>
                     <asp:BoundField DataField="Label" />
                 </Columns>
             
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                   <RowStyle BackColor="#EFF3FB" />
                   <SelectedRowStyle BackColor="#FF5050" />
                   <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="20px" 
                        Width="30px" />
                        
                    <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <EditRowStyle BackColor="LightGray" />
                    <RowStyle CssClass="AlternativeRowStyle" />
                    <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
                    
                 
             </asp:GridView >
             
            <cc2:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtPurchaseDate" PopupButtonID="imgCalendar">
            </cc2:CalendarExtender> 
                    
            
                 <asp:ObjectDataSource ID="dsMessage" runat="server" SelectMethod="GetMessage" 
                     TypeName="DirectService"></asp:ObjectDataSource>
             <br />
             </td>    
  </tr>
  <tr><td valign="top">
  <div style="height:auto; width:auto; overflow:auto"> 
                    
            
 <asp:GridView ID="grdEquipment" runat="server" AllowPaging="True" 
                    AllowSorting="True" AutoGenerateColumns="False" BorderStyle="None" 
                    CssClass="GridItem" DataKeyNames="SparepartId" DataSourceID="odsEquipAlert" 
                    Height="300px" 
                    
                    
                    RowHeaderColumn="EquipmentId" width="720px" 
          onrowcommand="grdEquipment_RowCommand" PageSize="12" 
                    >
                    <HeaderStyle BorderStyle="None" CssClass="GridViewHeader" Height="20px" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                       
                       
                        <asp:BoundField DataField="SparepartId" HeaderText="ID Nº">
                            <ItemStyle HorizontalAlign="Left" Width="50px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="PurchaseDate" DataFormatString="{0:MM/dd/yyyy}" 
                            HeaderText="Purchase date" HtmlEncode="False">
                            <ItemStyle HorizontalAlign="Left" Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="System" HeaderText="System">
                            <ItemStyle HorizontalAlign="Left" Width="50px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TYPEEQUIPMENT" HeaderText="Type">
                            <ItemStyle HorizontalAlign="Left" Width="100px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Model" HeaderText="Model">
                            <ItemStyle HorizontalAlign="Left" Width="150px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="MINIMUMINSTOCK" HeaderText="Min">
                            <ItemStyle HorizontalAlign="Right" Width="30px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="MAXIMUMINSTOCK" HeaderText="Max">
                            <ItemStyle HorizontalAlign="Right" Width="30px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="QTY" HeaderText="In">
                            <ItemStyle HorizontalAlign="Right" Width="30px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="NBOUT" HeaderText="Out">
                            <ItemStyle HorizontalAlign="Right" Width="30px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="balance" HeaderText="Balance">
                            <ItemStyle HorizontalAlign="Right" Width="40px" />
                        </asp:BoundField>
                    </Columns>
                    <PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <EditRowStyle BackColor="LightGray" />
                    <RowStyle CssClass="AlternativeRowStyle" />
                    <AlternatingRowStyle BackColor="White" CssClass="AlternativeRowStyle" />
                </asp:GridView>
   
 </div>      
         
    <asp:ObjectDataSource ID="odsEquipAlert" runat="server" 
        SelectMethod="GetSparepartWarrantyAlert" TypeName="DirectService" 
          OldValuesParameterFormatString="original_{0}" 
          onselected="odsEquipAlert_Selected">
        <SelectParameters>
            <asp:ControlParameter ControlID="txtPurchaseDate" Name="purchaseD" 
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    </td></tr>
    </table>
    
</asp:Content>
